﻿using System.Collections;
using Gp.Scripts.Core;
using Gp.Scripts.GUI;

namespace Gp.Scripts.Core {
    public abstract class ReactionRegister<T> where T : ReactionArgs {
        protected readonly BaseUnit Unit;

        protected ReactionRegister(BaseUnit unit) {
            Unit = unit;
        }


        // public ReactionEventWrapper<T> ToWrapper() {
        //     return new ReactionEventWrapper<T>(Unit, OnTrigger, OnRender, CanPerform, OnSelect);
        // }

        protected virtual IEnumerator OnSelect(T arg) {
            yield break;
        }

        protected abstract bool CanPerform(T arg);

        protected abstract void OnRender(T arg, ReactionRenderInfo info);

        protected abstract IEnumerator OnTrigger(T arg);
    }
}